<script type="text/javascript"
     src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<head>
    <link rel="stylesheet" href="stylesheet_TMATS.css">
</head>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<title>
    T-MATS: Help for PT2S Library Block
</title>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<body>
    <h1>
      T-MATS: PT2S Library Block
    </h1>
<hr>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="purpose">
        Purpose
</div>

<p>
    This block can be used to empirically calculate entropy (S) from input
    values of pressure (P), temperature (T), and fuel to air ratio (FAR).
    The temperature and pressure inputs must be of the same type, either
    static or total, otherwise the calculated value of entropy will be incorrect.
    For example, using total temperature with static pressure will produce
    an incorrect entropy value.
</p>

<br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="background">
        Background
</div>

<p>
    To compute the entropy, this block utilizes a table-lookup method based
    on data from standard thermodynamic tables for a combination of
    air and combusted hydrocarbons. The calculations are made
    from the built-in curve fit data, using the basic equation of:

    $$s = \frac{s_f*n_{f,p}+s_a*n_{a,p}}{n_{f,p}+n_{a,p}}$$

    in which

    $$s_a = d_{sa,i}*\Delta T^3 + c_{sa,i}*\Delta T^2 + b_{sa,i}*\Delta T + a_{sa,i} $$

    and

    $$s_f = d_{sf,i}*\Delta T^3 + c_{sf,i}*\Delta T^2 + b_{sf,i}*\Delta T + a_{sf,i} $$
    <br>

    In the above equations, <i>&Delta;T</i> is the difference between the given
    temperature value and an index value that is obtained from a data array
    as a function of the integer value of one percent of the assigned gas
    temperature.
</p>

<br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="instructions">
        Instructions
</div>

<p>
    To use this block:
    <ul>
        <li> Connect the temperature, pressure, and fuel to air ratio inputs
        to the corresponding places on the block.
        <li> Connect the entropy output to the next block in your simulation.

    </ul>
</p>

<br><hr><br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="inputs">
        PT2S Inputs
</div>

<table>
    <tr><th> Input </th><th >Description</th></tr>
    <tr><td>T</td><td>Temperature [degR] </td></tr>
    <tr><td>P</td><td>Pressure [psia] </td></tr>
    <tr><td>FAR</td><td>Fuel to Air Ratio[frac]</td></tr>
</table>

<br><br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="outputs">
        PT2S Outputs
</div>

<table>
    <tr><th> Output </th><th> Description </th></tr>
    <tr><td>S</td><td>Entropy [BTU/(lbm*degR)] </td></tr>
</table>

<br><br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="maskvars">
        PT2S Mask Variables
</div>
<p>
    No mask variables are needed for this block, as all calculations are
    based on the input values.
</p>

<br><hr><br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class = "errors">
    Potential Errors
</div>
<p>
When using this block, you may receive one of the following errors/warnings. The table
below lists the errors/warnings that you may see and the reason why it is being displayed.
</p>
<table>
    <tr><th> Error/Warning </th><th>Description</th></tr>
    <tr><td>Three inputs required</td><td>One or more inputs are not connected to the block.</td></tr>
    <tr><td>One output required</td><td>The output is not connected to anything.</td></tr>
    <tr><td>Pressure input must be a scalar</td><td>Error is displayed when the pressure
    input has more than one element. </td></tr>
    <tr><td>Temperature input must be a scalar</td><td>Error is displayed when the temperature
    input has more than one element.</td></tr>
    <tr><td>FAR input must be a scalar.</td><td>Error is displayed when the FAR input
    has more than one element.</td></tr>
</table>


<br><br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
</body>